package com.zq.vaccinum.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zq.vaccinum.domain.entity.UserInfo;
import com.zq.vaccinum.mapper.UserInfoMapper;
import com.zq.vaccinum.service.IUserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

/**
 * <p>
 * 用户信息 服务实现类
 * </p>
 *
 * @author zq
 * @since 2023-05-27
 */
@Service
public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo> implements IUserInfoService {
    @Autowired
    private UserInfoMapper userInfoMapper;

    @Override
    public HashMap getAllUserInfoList(Integer pageNum, Integer pageSize) {
        HashMap result = new HashMap();
        Page<UserInfo> page = userInfoMapper.selectPage(new Page<UserInfo>(pageNum, pageSize),null);
        List<UserInfo> list = page.getRecords();
        result.put("list", list);
        result.put("total", page.getTotal());
        return result;
    }
}
